package com.ysu.zyw.modal.po;

import com.ysu.zyw.modal.dto.BlogRegisterInformation;

import java.util.UUID;

/**
 * Created by zhang_yao_wu1993 on 15/4/24.
 *
 * @author by Zerur
 */
public class BlogUserEntity {
    private int id;
    private String uuid;
    private String username;
    private String password;
    private String nickname;
    private String qq;
    private String email;
    private String authority;

    public BlogUserEntity(BlogRegisterInformation blogRegisterInformation) {
        this.id = -1;
        this.uuid = UUID.randomUUID().toString();
        this.username = blogRegisterInformation.getUsername();
        this.password = blogRegisterInformation.getPassword();
        this.nickname = blogRegisterInformation.getNickname();
        this.qq = blogRegisterInformation.getQq();
        this.email = blogRegisterInformation.getEmail();
        this.authority = "ROLE_USER";
    }

    @Override
    public String toString() {
        return "UserPo{" +
                "id=" + id +
                ", uuid='" + uuid + '\'' +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", nickname='" + nickname + '\'' +
                ", qq='" + qq + '\'' +
                ", email='" + email + '\'' +
                ", authority='" + authority + '\'' +
                '}';
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getQq() {
        return qq;
    }

    public void setQq(String qq) {
        this.qq = qq;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getAuthority() {
        return authority;
    }

    public void setAuthority(String authority) {
        this.authority = authority;
    }
}
